<!--
 * @Author: luwei
 * @Date: 2021-05-24 15:44:56
 * @LastEditors: luwei
 * @LastEditTime: 2021-06-03 13:58:13
 * @Description: 视频或图片弹窗
-->

<template>
    <div class="videoImgDetail">
        <img style="width:100%;" v-if="videoImgArr.item.substr(videoImgArr.item.length - 3) == 'png' || videoImgArr.item.substr(videoImgArr.item.length - 4) == 'jpeg' || videoImgArr.item.substr(videoImgArr.item.length - 3) == 'gif' || videoImgArr.item.substr(videoImgArr.item.length - 3) == 'jpg' || videoImgArr.item.substr(videoImgArr.item.length - 3) == 'bmp' || videoImgArr.item.substr(videoImgArr.item.length - 3) == 'pic'" :src="videoImgArr.item" alt="">
        <video ref="videoEl" v-else :src="videoImgArr.item" controls style="width:100%;"></video>
    </div>
</template>
<script>
export default {
    data(){
        return{
            
        }
    },
    props:{
        videoImgArr:{
            type: Object,
            default() {
                return false
            }
        }
    },
    created(){

    },
    methods:{
        stopVideo(){
            if(this.videoImgArr.item.substr(this.videoImgArr.item.length - 3) == 'png' || this.videoImgArr.item.substr(this.videoImgArr.item.length - 4) == 'jpeg' || this.videoImgArr.item.substr(this.videoImgArr.item.length - 3) == 'gif' || this.videoImgArr.item.substr(this.videoImgArr.item.length - 3) == 'jpg' || this.videoImgArr.item.substr(this.videoImgArr.item.length - 3) == 'bmp' || this.videoImgArr.item.substr(this.videoImgArr.item.length - 3) == 'pic'){

            }else{
                this.$refs.videoEl.pause()
            }
            
        }
    }
}
</script>
<style lang="scss">

</style>
